#include <stdio.h>

int main(){
    int score[10] = {5, 4, 6, 8, 9, 0, 1, 2, 7, 3};
    int score_len = sizeof(score) / sizeof(score[0]);
    int score_max = score[0];
    int score_min = score[0];
    int score_filtered_len = 0;
    for(int i = 0; i < score_len; i++){
        if(score_max < score[i]){
            score_max = score[i];
        }
        if(score_min > score[i]){
            score_min = score[i];
        }
    }
    // 去掉最高分和最低分的总和
    int sum_filtered = 0;
    for(int i = 0; i < score_len; i++){
        if((score[i] != score_max) && (score[i] != score_min)){
            sum_filtered += score[i];
            score_filtered_len++;
        }
    }
    double score_average = (double)sum_filtered / score_filtered_len; 
    printf("平均分：%lf\n", score_average);

    return 0;

}